/* 
 * File:   primitives.h
 * Author: gustavo
 *
 * Created on March 14, 2012, 2:14 PM
 */

#ifndef STAT_PRIMITIVES_H
#define	STAT_PRIMITIVES_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <util/types.h>

	inline real __vsum(int m, real * vA, int inca);
	inline real __vmean(int m, real * vA, int inca);
	inline void __msum(int m, int n, real * mA, int sta, real * vS, int incs);
	inline void __msum_row(int m, int n, real * mA, int sta, real * vS, int incs);
	inline void __mmean(int m, int n, real * mA, int sta, real * vM, int incm);
	inline void __mmean_row(int m, int n, real * mA, int sta, real * vM, int incm);

	inline real __vmax(int m, real * vA, int inca, real * max, int * id);
	inline real __vmin(int m, real * vA, int inca, real * max, int * id);

	inline void __vminmax(int m, real * vA, int inca, real * min, real * max);
	inline void __vminmax_id(int m, real * vA, int inca, real * min, int * id_min, real * max, int * id_max);






#ifdef	__cplusplus
}
#endif

#endif	/* STAT_PRIMITIVES_H */

